 /*     adv7390.h for Linux .
  *
  * author : xiaozhi
  * date   : 2013/8/15
  *      
  */

#ifndef _ADV7390_H
#define _ADV7390_H



#define STAND_OUT	0x0
#define HIGH_OUT	0x2
#define GAIN_OUT	0x7

typedef union {
	struct 
	{
		unsigned char reserved0 : 1;
		unsigned char ddr_time_align : 2;
		unsigned char reserved3 : 1;
		unsigned char input_mode : 3;
		unsigned char reserved7 : 1;
	}bit;

	unsigned char b8;

}mode_select;

typedef struct adv7390_image_adjust
{
	unsigned char chip;			// [0-2] : 0:第一组...
	unsigned char hue;
	unsigned char contrast;
	unsigned char brightness;	//	[6:0] -> 0 ~ 63
	unsigned char saturation;
}adv7390_image_adjust;


typedef struct _adv7390_reg adv7390_reg;

struct adv7390_reg
{
	unsigned char chip;		// [0-2] : 0:第一组...
	unsigned char reg;
	unsigned char value;
};


#define ADV7390_IOC_MAGIC	'V'

#define ADV7390_STAND_MODE	_IOWR(ADV7390_IOC_MAGIC, 1, mode_select)
#define ADV7390_HIGH_MODE	_IOWR(ADV7390_IOC_MAGIC, 2, mode_select)
#define SD_IMAGE_SET_ADJUST		_IOWR(ADV7390_IOC_MAGIC, 3, unsigned char)	
#define SD_IMAGE_GET_ADJUST		_IOWR(ADV7390_IOC_MAGIC, 4, unsigned char)



#define ADV7390_GET_ALL_REG			_IOWR(ADV7390_IOC_MAGIC, 116, unsigned char) 
#define ADV7390_GET_SIGNLE_REG		_IOWR(ADV7390_IOC_MAGIC, 117, unsigned char) 
#define ADV7390_SET_SIGNLE_REG		_IOWR(ADV7390_IOC_MAGIC, 118, unsigned char) 













#endif

